package com.aabbc.v3;

import lombok.Data;

/**
 * ModRule
 *
 * @author: chenfenghai
 * @version: 1.0
 * @date: 2020-05-28 9:39
 * @blame Team
 */
@Data
public class ModRule implements Rule {

    private int in;
    private String out;

    public ModRule(int in, String out){
        this.in = in;
        this.out = out;
    }

    public static ModRule of(int in, String out){
        return new ModRule(in, out);
    }

    @Override
    public String say(int i) {
        return i % in == 0 ? out : null;
    }
}
